import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 模板字段
 */
@Entity('medical_template_field')
export class MedicalTemplateFieldEntity extends BaseEntity {
  @Index()
  @Column({ comment: '模板ID' })
  templateId: number;

  @Column({ comment: '字段名称' })
  fieldName: string;

  @Column({
    comment: '字段类型',
    dict: ['输入框', '单选', '多选', '日期', '文件'],
  })
  fieldType: number;

  @Column({ comment: '是否必填', default: 0, dict: ['否', '是'] })
  required: number;

  @Column({ comment: '排序号', default: 0 })
  orderNum: number;

  @Column({ comment: '选项值', nullable: true })
  options: string;
}
